# for i in range(5):
#     print('hello')
#     print(i)
# print(list(range(10)))

#高斯求和
# result = 0
# for i in range(101):
#     result += i
# print(result)

#1! + 2! + 3! +...+n!
# n = 10
# result = 1
# total = 0
# for i in range(n+1):
#     if i>0:
#         result *= i
#         total += result
# print(total)
#
#
# total = 0
# for n in range(10):
#     result = 1
#     for i in range(n+1):
#         result *= (i + 1)
#     print(result)
#     total += result
# print(total)

#1! + 2! + 3! +...+n!
result2 = 0
n = 1
result = 1
while n<= 4:
    result *= n
    result2 += result
    n += 1
print(result2)


